import pygame
from globals import *

class Tile:
	def __init__(self, position, isWall = False):
		self.position = position
		self.isWall = isWall
		self.snakes = []
		
	def getSymbol(self):
		aliveSnakes = filter (lambda snake: snake.isAlive, self.snakes)
		if self.isWall:
			return WALL
		elif aliveSnakes == []:
			return EMPTY
		else:
			return aliveSnakes[0].symbol

	def isEmpty(self):
		if self.isWall: return False
		aliveSnakes = filter (lambda snake: snake.isAlive, self.snakes)
		return not aliveSnakes
